package com.bw.product.server.controller;

import com.bw.common.core.domain.Result;
import com.bw.common.core.web.controller.BaseController;
import com.bw.product.server.service.ItemInfoService;
import com.bw.product.server.vo.ItemInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutionException;

@RestController
@RequestMapping("/item")
public class ItemInfoController extends BaseController {

    @Autowired
    private ItemInfoService itemInfoService;

    @GetMapping("selectSkuItemInfoBySkuId/{skuId}")
    public Result<ItemInfoVo> selectSkuItemInfoBySkuId(@PathVariable Long skuId) throws ExecutionException, InterruptedException {
        ItemInfoVo itemInfoVo = itemInfoService.selectSkuItemInfoBySkuId(skuId);
        return Result.success(itemInfoVo);
    }

}
